package pnu.ssm.question;


import java.io.Serializable;

public class Question implements Serializable{
	/**
	 * 
	 */
	private static final long serialVersionUID = 3848533651084415757L;
	
	private int questionNum = 0;
	private String question = "다음 중 어울리지 않는 것은?";
	private String[] arrAnswer = new String[] {"apple", "banana", "melon", "clock", "orange"};
	private int correctAnswerNum = 4;
	
	public boolean isCorrect(int userAnswer) {
		return userAnswer == correctAnswerNum;
	}
	
	public int getQuestionNum() {
		return questionNum;
	}
	public void setQuestionNum(int questionNum) {
		this.questionNum = questionNum;
	}
	public String getQuestion() {
		return question;
	}
	public void setQuestion(String question) {
		this.question = question;
	}
	
	/*public String[] getArrAnswer() {
		String[] answerList = arrAnswer.clone();
		
		for (int i = 0; i < answerList.length; i++) {
			int nRand = (int)(Math.random() * answerList.length);
			
			//swap
			String str = answerList[0];
			answerList[0] = answerList[nRand];
			answerList[nRand] = str;
		}
		
		return answerList;
	}*/
	
	public String[] getArrAnswer() {
		return arrAnswer;
	}
	
	public void setArrAnswer(String[] arrAnswer) {
		this.arrAnswer = arrAnswer;
	}
	public int getCorrectAnswerNum() {
		return correctAnswerNum;
	}
	public void setCorrectAnswerNum(int correctAnswerNum) {
		this.correctAnswerNum = correctAnswerNum;
	}
}